using Common.Unity.Testing.Objects;
using Microsoft.Practices.Unity;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Testing.Core;

namespace Common.Unity.Testing
{
	[TestClass]
	public class TypeInjectionElementTests : TestBase
	{
		[TestMethod, Owner( TestOwners.MichaelD_Bang )]
		public void VerifyMappedNamedTypeObjectPropertiesInjectedProperly()
		{
			UnityContainer container = UnityConfiguration.Create();
			INamedTypeObject target = container.Resolve<INamedTypeObject>( "Default" );
			Assert.AreEqual( "Mapped Named-Type Object", target.Name );
			Assert.AreEqual( typeof(string), target.Type );
		}

		[TestMethod, Owner( TestOwners.MichaelD_Bang )]
		public void VerifyNormalNamedTypeObjectPropertiesInjectedProperly()
		{
			UnityContainer container = UnityConfiguration.Create();
			INamedTypeObject target = container.Resolve<NamedTypeObject>( "Normal" );
			Assert.AreEqual( "Named-Type Object", target.Name );
			Assert.AreEqual( typeof(int), target.Type );
		}

	}
}